package mydate;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 第一代日期类 jdk1.0引入
 * @author Raymond
 * @create 2025/4/23 14:53
 */
public class MyDate {
    public static void main(String[] args) throws ParseException {
        Date date = new Date();
        //原始格式
        System.out.println("date = " + date);
        //格式转换
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy MM dd<=>HH mm ss");
        String format = simpleDateFormat.format(date);
        System.out.println("format = " + format);

        //将指定的字符串转为时间
        Date parse = simpleDateFormat.parse("2021 06 30<=>02 22 33");
        System.out.println("parse = " + parse);
    }
}
